package com.mengfx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mengfx.bean.NiuDanSku;
import com.mengfx.mapper.NiuDanSkuMapper;
import com.mengfx.service.NiuDanSkuService;

@Service("niuDanSkuService")
public class NiuDanSkuServiceImpl implements NiuDanSkuService {

	@Autowired
	private NiuDanSkuMapper niuDanSkuMapper;
	
	public List<NiuDanSku> getNiuDanSkuListById(Long niuDanId) {
		return niuDanSkuMapper.getNiuDanSkuListById(niuDanId);
	}

	public boolean insertNiuDanSku(NiuDanSku record) {
		return niuDanSkuMapper.insertSelective(record) > 0;
	}

	public boolean deleteSkuById(Long id) {
		NiuDanSku sku = new NiuDanSku();
		sku.setId(id);
		sku.setArchive(true);
		return niuDanSkuMapper.updateByPrimaryKeySelective(sku) > 0;
	}

}
